# coding: utf-8

from wtforms import StringField
from wtforms.validators import Optional

from .constant import CallType, AnswerState
from app.forms import WphForm, NonValidatingSelectField, NotChoices
from app.op.constant import OperateResult


class SearchSevenMoorRecordForm(WphForm):
    """
    add by zhouhl 2018-01-15
    搜索七陌通话记录表单
    """
    customer_no = StringField('客户号码', validators=[Optional()])
    call_type = NonValidatingSelectField(
        '发起方式',
        choices=NotChoices + CallType.to_options(),
        validators=[Optional()],
    )
    answer_state = NonValidatingSelectField(
        '接听状态',
        choices=NotChoices + AnswerState.to_options(),
        validators=[Optional()],
    )
    transform_result = NonValidatingSelectField(
        '转换结果', coerce=int,
        choices=[(-1, '所有')] + OperateResult.to_options(),
        validators=[Optional()],
    )
